package com.ssy.lingxi.purchase.service.online;

import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.purchase.api.dto.request.BaseDetailsRequest;
import com.ssy.lingxi.purchase.api.dto.request.bidding.BiddingListRequest;
import com.ssy.lingxi.purchase.api.dto.request.bidding.BiddingProductRequest;
import com.ssy.lingxi.purchase.api.dto.request.online.OnlineSignUpRequest;
import com.ssy.lingxi.purchase.api.dto.request.online.SubmitReportPriceRequest;
import com.ssy.lingxi.purchase.api.dto.response.BiddingExternalWorkStateEnumResponse;
import com.ssy.lingxi.purchase.api.dto.response.bidding.*;
import com.ssy.lingxi.purchase.api.dto.response.online.OnlineBiddingDetailsResponse;
import com.ssy.lingxi.purchase.entity.onlinebidding.OnLineBidding;

import java.util.List;

/**
 *在线竞价
 */
public interface OnlineBiddinService {

    /**
     *采购竞价单查询
     */
     Wrapper<PageData<BiddingListResponse>> biddingList(BiddingListRequest request,UserLoginCacheDTO sysUser);

    /**
     *采购竞价单详情
     */
    Wrapper<OnLineBiddingDetailsResponse> biddingDetails(BaseDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     * 采购物料分页查询
     */
    Wrapper<PageData<BiddingProductRequest>> materielPage(BaseDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     *使用竞价单ID查询 最低竞价信息
     */
    Wrapper<PageData<AwardProcessDetailsResponse>> minimumBidding(BaseDetailsRequest request,UserLoginCacheDTO sysUser);

    /**
     *采购竞价单详情-授标结果 使用竞价单ID查询
     */
    Wrapper<PageData<AwardProcessDetailsResponse>> awardResultsBidding(BaseDetailsRequest request,UserLoginCacheDTO sysUser);

    /**
     *采购竞价单详情-查询竞价过程
     */
    Wrapper<List<AwardProcessResponse>> process(BaseDetailsRequest request,UserLoginCacheDTO sysUser);

    /**
     *待竞价报名列表
     */
    Wrapper<PageData<BiddingListResponse>> stayExamineBiddingSignup(BiddingListRequest request,UserLoginCacheDTO sysUser);

    /**
     * 创建在线竞价实体 - 采购商提交采购竞价单后
     * @param id 采购竞价单id
     * @param biddingNo 采购竞价单编号
     * @param externalState 采购竞价单外部状态
     */
    OnLineBidding createOnlineBidding(Long id, String biddingNo, Integer externalState);

    /**
     *竞价报名
     */
    Wrapper<Void> onlineSignUp(OnlineSignUpRequest request,UserLoginCacheDTO sysUser);

    /**
     *待竞价列表
     */
    Wrapper<PageData<BiddingListResponse>> stayBiddingList(BiddingListRequest request,UserLoginCacheDTO sysUser);

    /**
     *待竞价详情
     */
    Wrapper<OnlineBiddingDetailsResponse> stayBiddingDetails(BaseDetailsRequest request, UserLoginCacheDTO sysUser);

    /**
     *竞价-提交报价
     */
    Wrapper<Void> submitReportPrice(SubmitReportPriceRequest request,UserLoginCacheDTO sysUser);

    /**
     * 获取采购报价单内部流程状态
     */
     Wrapper<List<BiddingExternalWorkStateEnumResponse>> interiorStatus();

    /**
     * 获取采购报价单外部流程状态
     */
    Wrapper<List<BiddingExternalWorkStateEnumResponse>> externalStatus();

    /**
     * 记录在线报价内部流转记录
     */
    void initOnlineInteriorLog(UserLoginCacheDTO sysUser, Integer operation, Integer state, Long onlineBiddingId, String discardCaues);
}
